<?php
namespace App\Http\Service\User;


use App\Http\Service\Basic\BasicService;
use Config;

class UserService extends BasicService
{

    //构造函数
    function __construct()
    {
        parent::__construct();
    }


    //登录
    public function login($where = array())
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.login'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.login'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }


    //注销
    public function logout($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.logout'), json_encode($where), 'post');
    }


    //注测
    public function register($where = array())
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.register'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.register'), json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }

    //注测
    public function Setting($where = array())
    {
        $url = '';
        if(!empty($where['token']))
        {
            $url = "?token=".$where['token'];
        }
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.info').$url, 'get');
    }

    /**
     * @param $where
     * @return bool|mixed
     * 获取验证码
     */
    public function getCode($where)
    {

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.getCode'),$where,'get');
    }


    public function getAreaList()
        {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.getarealist'));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.getarealist'));
    }


    /**
     * 客户接口
     */
    public function getAreaLineData($where)
    {

//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.arealines'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.arealines'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }



    /**
     * @param array $where
     * @return bool|mixed
     * 用户名获取用户ID
     */
    public function accountGetUserId($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.account_user_id'),$where, 'get');
    }

    /**
     * @param array $where
     * @return bool|mixed
     * 优惠码
     */
    public function discountCoupon($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.discountCoupon'),$where, 'get');
    }

    //   更新密码
    public function updatePassword($where = array())
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_password'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_password'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }

    /**
     * @param array $where
     * @return bool|mixed
     * 修改邮箱
     */
    public function updateEmail($where = array())
    {

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_email'),$where, 'get');
    }

    /**
     * @param array $where
     * @return bool|mixed
     * 修改QQ
     */
    public function updateQQ($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_qq'),$where, 'get');
    }

    /**
     * @param array $where
     * @return bool|mixed
     * 更新QQ
     */
    public function updatePhone($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.update_phone'),$where, 'get');
    }

    //   获取用户信息
    public function getUserInfo($where = array())
    {
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.user_info').$where['token']);
    }



    public function KeFuqq($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.kefuqq'), $where);
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.kefuqq'), $where, 'get');

    }

    public function getTeamqq()
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.getTeamqq'));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.getTeamqq'), 'get');

    }



    public function putCode($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.code'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.code'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');

    }

    public function getvalidateCode($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get/code'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH') . Config::get('custom.api.get/code'),json_encode($where,JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 'post');
    }







}